<?php
$dir_path = "photos/";
$dir_handle = @opendir($dir_path) or die("파일목록 얻기에 실패했습니다.");
while(($filename=readdir($dir_handle))!=FALSE) {
	if (is_dir($dir_path . $filename) && $filename != ".." && substr($filename,0,1) != ".")
		echo "<a href=\"gallery.php?path=/" . $filename . "\">" . $filename . "</a><br />\n";
}
closedir($dir_handle);
?>